<%@ page language="java" trimDirectiveWhitespaces="true" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="z" tagdir="/WEB-INF/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<z:layout title="Visualizar Funcionários" page_header_title="Visualizar"
	      page_header_description="todos os funcionários">

		<c:if test="${not empty param.deletado}">
			<div class="alert alert-success">
				<i class="icon-smile"></i> <strong>Funcionário ${param.deletado} deletado com sucesso!</strong>
			</div>
		</c:if>

	<table cellpadding="0" cellspacing="0" border="0"
		class="table table-striped table-bordered" id="clientes_table"
		width="100%">
		<thead>
			<tr>
				<th width="5%">ID</th>
				<th width="15%">Login</th>
				<th width="20%">Nome</th>
				<th width="20%">CPF</th>
				<th width="15%">Emails</th>
				<th width="20%" colspan="2" class="center-helper">Ações</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach items="${funcionarios}" var="funcionario">
				<tr>
					<td><a href="view/funcionarios/mostrar.do?id=${funcionario.idUsuario}">${funcionario.idUsuario}</a></td>
					<td>${funcionario.login}</td>
					<td>${funcionario.nome}</td>
					<td>${funcionario.cpf}</td>
					<td>${funcionario.emails[0].email}</td>
					<td class="center-helper"><a
						href="view/funcionarios/editar.do?id=${funcionario.idUsuario}"
						class="btn btn-primary">Editar</a></td>
					<td class="center-helper"><a
						href="view/funcionarios/deletar.do?id=${funcionario.idUsuario}"
						class="btn btn-danger confirm">Excluir</a></td>
				</tr>
			</c:forEach>
		</tbody>
		<tfoot>
			<tr>
				<th>ID</th>
				<th>Login</th>
				<th>Nome</th>
				<th>CPF</th>
				<th>Emails</th>
				<th colspan="2" class="center-helper">Ações</th>
			</tr>
		</tfoot>
	</table>

</z:layout>